package com.patterns.iterator.prodjectIterator;

/**
 * Created by Xiao Yiyun on 2017/6/28.
 * 老板看报表
 */
public class Boss {

    public static void main(String[] args) {
        //定义一个list，存放所有的项目对象
        IProject project = new Project();
        //增加星球大战项目
        project.add("星球大战项目",10, 1000000);
        //增加扭转时空项目
        project.add("扭转时空项目", 20, 10000000);
        //增加超人改造项目
        project.add("超人改造项目", 10, 10000);
        //这边100个项目
        for (int i=4; i<104; i++) {
            project.add("第" + i + "个项目", i*5,  i*10000);
        }
        //遍历一下ArrayList，把所用的数据都取出来
        ProjectIterator projectIterator = (ProjectIterator) project.iterator();
        while (projectIterator.hasNext()) {
            IProject p = (IProject)projectIterator.next();
            System.out.println(p.getProjectInfo());
        }
    }
}
